<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page import="net.tribal.comic.entities.Comic" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title><g:message code="title.page.edit.nav"/></title>
    </head>
    <body>
		<g:form action="updateProfile">
			<div class="element rounded-corners">
				<div class="navButtonsTop rounded-corners">
					<h1 class="title"><g:message code="title.page.edit.profile" args="[pageInstance.title]"/></h1>
				</div>
		
				<g:hasErrors bean="${comicInstance}">
					<div class="errors rounded-corners"><g:renderErrors bean="${comicInstance}" as="list" /></div>
				</g:hasErrors>
			            
	            	<div class="tableCreate">
	                    <table>
	                        <tbody>
	                            <tr>
	                                <td class="name">
	                                    <label for="title"><g:message code="default.label.title"/>:</label>
	                                </td>
	                                <td colspan="5" class="value requiredField ${hasErrors(bean: comicInstance, field: 'title', 'errors')}">
	                                    <g:textField class="focus" name="title" maxlength="50" value="${fieldValue(bean: comicInstance, field: 'title')}" />
	                                </td>
	                            </tr>
	                        
	                            <tr>
	                                <td colspan="6" class="value ${hasErrors(bean: comicInstance, field: 'description', 'errors')}">
		                                <richui:richTextEditor name="description" value="${comicInstance?.description}" width="600"/>
	                                </td>
	                            </tr>
	                        
	                            <tr>
	                                <td class="name">
	                                	<usr:isAdmin>
	                                    	<label for="disabled"><g:message code="default.label.disabled"/>:</label>
	                                    </usr:isAdmin>
	                                </td>
	                                <td class="value ${hasErrors(bean: comicInstance, field: 'disabled', 'errors')}">
	                                	<usr:isAdmin>
	                                    	<g:checkBox name="disabled" value="${comicInstance?.disabled}" />
	                                    </usr:isAdmin>
	                                </td>
	                                <td class="name">
	                                    <label for="commentable"><g:message code="default.label.commentable"/>:</label>
	                                </td>
	                                <td class="value ${hasErrors(bean: comicInstance, field: 'commentable', 'errors')}">
	                                    <g:checkBox name="commentable" value="${comicInstance?.commentable}" />
	                                </td>
	                                <td class="name">
	                                    <label for="rateable"><g:message code="default.label.rateable"/>:</label>
	                                </td>
	                                <td class="value ${hasErrors(bean: comicInstance, field: 'rateable', 'errors')}">
	                                    <g:checkBox name="rateable" value="${comicInstance?.rateable}" />
	                                </td>
	                            </tr>
	                        </tbody>
	                    </table>
					</div>
	        </div>
	                
			<div class="navButtons rounded-corners">
				<div class="left">
					<usr:itsMine target="${pageInstance.createdBy.id}">
                 		<g:actionSubmit class="save" action="update" value="${message(code:'default.button.update')}" />
                	</usr:itsMine>
                 </div>
                  	
				<div class="right">
					<g:actionSubmit class="show" action="show" value="${message(code:'default.button.back')}" />
				</div>
			</div>
					
			<g:hiddenField name="id" value="${pageInstance?.id}" />
            <g:hiddenField name="version" value="${pageInstance?.version}" />
	    </g:form>
    </body>
</html>